<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBlogTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('blog',function($table){
			$table->engine = 'InnoDB';
			$table->increments('id');
			//由用户自己定义的分类
			$table->integer('user_category_id')->default(1);
			$table->string('title')->default('');
			//博文摘要
			$table->string('abstracts')->default('');
			$table->text('content')->default('');
			//博文的标签关键词
			$table->string('tags')->default('');
			//博文系统分类
			$table->integer('system_category_id')->default(1);
			//博文是类型，1原创，2转载
			$table->tinyInteger('blog_type')->default(1);
			//博文原地址
			$table->string('origin_url')->default('http://');
			//是否所有人可见，默认可见
			$table->tinyInteger('privacy')->default(0);
			//是否允许评论，默认可以
			$table->tinyInteger('deny_comment')->default(0);
			//是否置顶，默认不置顶
			$table->tinyInteger('as_top')->default(0);
			$table->integer('user_id')->default(1);
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('blog');
	}

}
